<?php
session_start();
//此页为列表属性的显示页
require "../../../global.php";//$dirname."/".
require RootDir."/"."inc/config.php";
require RootDir."/"."inc/Uifunction.php";
require RootDir."/".$SystemConest[1]."/UIFunction/adminClass.php";
require RootDir."/".$SystemConest[1]."/system/Config.php";
require RootDir."/".$SystemConest[1]."/system/menusys/function.php";
require "../classsys/function.php";
$StrField=$_GET["StrField"];
$FieldName=$_GET["FieldName"];
$StrFieldArr=explode("|",$StrField);
$mydb=new YYBDB();
$MenuId=$StrFieldArr[2];

$TableName= $mydb->getTableName($MenuId);

CheckRule($StrFieldArr[2],$mydb,$TableName,"");//检查登陆权限
$FormConfig1=GetFormConfig($mydb,$MenuId);
$ArrField=explode("|",$StrField);

//获取上级栏目的属性是放在第几个字段里
$shangjiId=GetInputTypeIndex($FormConfig1,"14");


?>
<link href="../../Inc/Css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="TableLine">
   <tr class="YKTtable"><? echo  getTitle($mydb,$StrFieldArr[2]);?></tr>
  <?
   //为验证输入框的类型准备数据
   $sqlcheck="select * from ".$SystemConest[7].$SystemTablename[2]." where ".$SystemTablename[2]."0=".$StrFieldArr[2];
   
   $RsCheck=$mydb->db_query($sqlcheck);
   $RsCT=$mydb->db_fetch_array($RsCheck);
   $CheckStr=$RsCT[7];
   $CheckList[]=array();
   $k=0;
   $ArrCheckStr=explode(",",$CheckStr);
   foreach($ArrCheckStr as $values)
   {
	  $CheckList[$k]=explode("|",$values);
	  $k++;
   }
  
  $MenuIdnum= $mydb->getMenuIdNum($StrFieldArr[2]);
  $sql="select *  from ".$SystemConest[7].$TableName." where ".$TableName.$MenuIdnum."=".$StrFieldArr[2]." and ".$TableName.$shangjiId."=".$_REQUEST["cid"];
  
  $rsc=$mydb->db_query($sql);
  $strlist="";
  $k=0;
  while($rs=$mydb->db_fetch_array($rsc))
  {
	  $k++;
  ?>
  <form action="Action_ListProperty_save.php?<?php echo $_SERVER["QUERY_STRING"];?>" method="post" name="MyForm<?php echo $k;?>" id="MyForm<?php echo $k;?>">
   <tr>
   <?php
  
   
   for($i=0;$i<$ListPropertyPageTdNum-1;$i++)
   {?>
	<td align="center"><input type="text" name="FieldName_<?php echo $arrlistTitleNum[$i];?>" value="<?php echo $rs[$arrlistTitleNum[$i]];?>" size="8" ><div style="font-size:12px; margin-left:20px;" align="center">
    <span id="FieldName_<?php echo $arrlistTitleNum[$i];?>_Msg"><?php echo $CheckList[$arrlistTitleNum[$i]][3];?></span></div>
    	
        
    </td>   
   <?php }
   ?>
   <td align="center">
   <input type="hidden" name="id" id="id" value="<?php echo $rs[0];?>">
   <input name="edit" type="submit" value="修改" onClick="return CheckForm()"> <input name="del" type="button" value="删除" onClick="javascript:if(confirm('确实要删除吗?'))location='Action_ListProperty_del.php?<?php echo $_SERVER["QUERY_STRING"];?>&delc=del&id=<?php echo $rs[0];?>'"></td> 
   </tr>
   <?
        foreach($arrlistTitleNum as $value)
		{
			$strlist=$strlist.$value.",";
		}
		$strlist=substr($strlist,0,strlen($strlist)-1);
		?>
        <input type="hidden" value="<?php echo $strlist;?>" name="fieldsTitleNumerical">
  
   <input type="hidden" value="<? echo $shangjiId;?>" name="shangjiId">
    <input type="hidden" value="<? echo $_REQUEST["cid"];?>" name="cid">
        </form> <?php
  }
   ?>

  
   <form action="Action_ListProperty_save.php?<?php echo $_SERVER["QUERY_STRING"];?>" method="post" name="formAdd">
      <tr>
   <?php
   for($i=0;$i<$ListPropertyPageTdNum-1;$i++)
   {
	   foreach($arrlistTitleNum as $value)
		{
			$strlist=$strlist.$value.",";
		}
		$strlist=substr($strlist,0,strlen($strlist)-1);
	   ?>
	<td align="center"><input type="text" name="FieldName_<?php echo $arrlistTitleNum[$i];?>" value="" size="8"><div style="font-size:12px; margin-left:20px;" align="center">
    <span id="FieldName_<?php echo $arrlistTitleNum[$i];?>_Msg"><?php echo $CheckList[$arrlistTitleNum[$i]][3];?></span></div>
    </td>   
   <?php }
   ?>
   <td align="center"><input name="edit" type="submit" value="增加" onClick="return CheckForm()" /> </td> 
   </tr>
    <input type="hidden" value="<?php echo $strlist;?>" name="fieldsTitleNumerical">
   <input type="hidden" value="" name="id">
   <input type="hidden" value="<? echo $shangjiId;?>" name="shangjiId">
   <input type="hidden" value="<? echo $_REQUEST["cid"];?>" name="cid">
   </form>
</table>
<?
 Form_check();
 CheckForm($FormConfig1);
?>
